<!doctype html>
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title>主持人</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="js/header&footer.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/gbRst.js"></script>
<script type="text/javascript">
var _pageIndex = 0
var _flag=0;
$(function(){
	_shopId = getIdByName("shopId");
	getHost();
	$(window).scroll(function(){  
	    // 当滚动到最底部以上100像素时， 加载新内容  
	    if ($(document).height() - $(this).scrollTop() - $(this).height()==0){
	    	if(_flag==0){
	    		
	    	getHost();  
	    	}
	    } 
	});
})
function getHost(){	
	$.ajax({
		url:'../user/find/hostList/'+_shopId+'/'+_pageIndex+'/8',
		async:false,
		type:'get',
		success:function(data){
		var dt = JSON.parse(data);
			if(dt.state==0){
				if(dt.result.data.length==0){
					_flag=1
				}
					_pageIndex++;
				loadHost(dt)
				
			}
		}
	})

}

function loadHost(json){
	for ( var i = 0; i < json.result.data.length; i++) {
	var htm= "<dl onClick=\"redirectUrl('"+ getHeadIndexValue(i, json, "indexUrl") +"')\"><dt><img style='width:140px;height:156px;' src=\""+ getHeadIndexValue(i,json,"imageUrl") +"\"></dt><dd><span>姓名：</span>"+getHeadIndexValue(i, json, "cusName")+"</dd></dl>"	
	$("#hostList").append(htm)
	if((i+1)%2==0){
		$("#hostList").append("<div class='fc'></div>")
	}else if(i==(json.result.data.length-1)){
		$("#hostList").append("<div class='fc'></div>")
	}
	}
	
}

  

</script>
</head>

<body>
<div class="wrapper">
    <div class="container">
        <div class="hostImg" id="hostList">
        </div>
    </div>
</div>
</body>
</html>
